<script language='JavaScript'>
var errstr=null;
var bstartnextplay = false;
var fullscreen=false;
var $$ = function() { return document.getElementById(arguments[0]); } 
var coolurl = window.parent.geturl();
var url= "";
if (window.parent.geturl().indexOf("cool:") !=-1){
	url = window.parent.geturl().split("|");
	coolurl = url[0]+"|"+url[1]+"|["+document.domain+"]"+url[2]+"|";
}
document.write("<span id='playad' style='DISPLAY: none'><iframe src='http://union.maccms.com/gg/loading1.html' border='0' marginWidth='0' frameSpacing='0' marginHeight='0' frameBorder='0' noResize scrolling='no' width='100%' height='100%' vspale='0'></iframe></span>");
if(window.ActiveXObject){
	document.write("<object id='CoolPlayer' height='100%' width='100%' onerror='show_ad()'  name='CoolPlayer' classid='clsid:73BAB958-AC02-5108-B2B8-665834A9C63A'><param name='URL' value='"+ coolurl +"'><param name='AutoPlay' value='1'><PARAM NAME='CoolAdUrl' VALUE='http://union.maccms.com/gg/loading1.html'><PARAM NAME='NextWebPage' VALUE='"+window.parent.getNextUrl()+"'></object>");
}
else{
	document.write("<embed URL='"+ coolurl +"' height='100%' width='100%' type='application/cool-plugin'></embed>");
}

function showswf(offest)
{
	if (errstr ==null){
		if((CoolPlayer.PlayState==6||CoolPlayer.Duration==CoolPlayer.Currentpos)&&CoolPlayer.Duration!=0&&CoolPlayer.Currentpos!=0){
		}
		if($$('CoolPlayer').PlayState==3 ){
			$$('playad').style.display='none';
			$$('CoolPlayer').style.height = '100%';
		}
		else if ($$('CoolPlayer').Full==false){
			$$('CoolPlayer').style.height = 62;
			$$('playad').style.height=document.body.clientHeight-62;
			$$('playad').style.width=document.body.clientWidth;
			$$('playad').style.display='inline';
		}
		setfull();
		window.setTimeout('StartNextDownFile()',5000);
	}
}
function setfull(){
	if(window.parent.getautoFull()==1 && CoolPlayer.CurrentPos > 0 && !fullscreen){
		CoolPlayer.Full=true;
		fullscreen=true;
	}
}
function StartNextDownFile()
{
	if (errstr==null){
		if(CoolPlayer.get_CurTaskProcess() > 990 && !bstartnextplay){
			var url1 = window.parent.getNextUrl(true);
			var rv = CoolPlayer.StartNextDown(url1);
			bstartnextplay = true;
		}
	}
}
function show_ad(){
	errstr="err";
	$$('playad').innerHTML="<iframe border='0' src='http://union.maccms.com/gg/cool.html' marginWidth='0' frameSpacing='0' marginHeight='0' frameBorder='0' noResize scrolling='no' width='100%' height='100%' vspale='0' ></iframe>";
	$$('playad').style.display='inline';
}
if (errstr ==null){
	setInterval('showswf()','500');
}
</script>